﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Microsoft.Xna.Framework.Graphics;

namespace WindowsGame4
{
    class GameInfoLoader
    {
        private static GameInfoLoader gameInfoLoader;

        private GameInfoLoader()
        {

        }

        public static GameInfoLoader getInstance()
        {
            if (gameInfoLoader == null)
                gameInfoLoader = new GameInfoLoader();
            return gameInfoLoader;
        }
        
        public Dictionary<String,Model> loadModels()
        {
            Dictionary<String, Model> models = new Dictionary<string, Model>();

            StreamReader streamReader = new StreamReader("Content\\models.txt");

            String line = streamReader.ReadLine();
            while (line != null)
            {
                String idModel = line.Split(';')[0];
                Model model = new Model(idModel);
                
                line = streamReader.ReadLine();
            }

            return models;
        }
    }
}
/*
            Model modelFloor = new Model("floor");
            Texture2D tex_modelFloor = Content.Load<Texture2D>("floor");
            Frame frame3 = new Frame(new Texture(tex_modelFloor, 90, 90));
            Animation animation3 = new Animation("default",false);
            animation3.addFrame(frame3);
            modelFloor.addAnimation("default", animation3);
            models.Add("floor", modelFloor);*/